package com.simon.hse.activity.safe.jobticket;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;
import com.simon.hse.activity.safe.jobticket.electric.ElectricApplyActivity;
import com.simon.hse.activity.safe.jobticket.electric.ElectricQueryListActivity;
import com.simon.hse.activity.safe.workpermit.WorkPermitCancelQueryActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 临电作业许可证管理
 */
@SuppressWarnings("all")
@ContentView(R.layout.activity_job_ticket_electric)
public class JobTicketElectricManageActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;

    @ViewInject(R.id.iv_common_right)
    ImageView mIv_common_right;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mTv_common_title.setText("临电作业许可证管理");
        mIv_common_right.setImageResource(R.mipmap.tab_add_icon);
    }

    @Event(value = {R.id.iv_common_left, R.id.iv_common_right})
    private void back(View view) {
        switch (view.getId()) {
            case R.id.iv_common_left:
                finish();
            case R.id.iv_common_right:
                startActivity(new Intent(JobTicketElectricManageActivity.this, ElectricApplyActivity.class));
                break;
        }
    }

    @Event(value = {R.id.ll_query, R.id.ll_approval, R.id.ll_cancel_query, R.id.ll_cancel_approval})
    private void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_query:
                startActivity(new Intent(JobTicketElectricManageActivity.this, ElectricQueryListActivity.class));
                break;
            case R.id.ll_approval:
                startActivity(new Intent(JobTicketElectricManageActivity.this,ElectricQueryListActivity.class));
                break;
            case R.id.ll_cancel_query:
                startActivity(new Intent(JobTicketElectricManageActivity.this, WorkPermitCancelQueryActivity.class).putExtra("type","electric"));
                break;
            case R.id.ll_cancel_approval:
                startActivity(new Intent(JobTicketElectricManageActivity.this,ElectricQueryListActivity.class));
                break;
        }
    }
}
